package com.inews.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import android.util.Log;


public class JavaScriptUtil {
	
	public static final String pinHtmlAddress = "http://api.t.sina.com.cn/oauth/authorize";
	public static String PIN;

	/**
	 * 获取授权码.
	 *
	 * @param html the html
	 * @return the pin
	 */
	public void getPin(String html) {
		String reg = "[0-9]{6}";
		Pattern pattern = Pattern.compile(reg);
		Matcher matcher = pattern.matcher(html);
		if(matcher.find()){
			String pin = matcher.group(0);
			Log.i("授权码", pin);
			PIN = pin;
		}
	}

}
